<%--
  Created by IntelliJ IDEA.
  User: xxswh
  Date: 2021/3/14
  Time: 9:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图书管理</title>
    <link rel="stylesheet" href="../css/csscustomer.css">
    <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../font-awesome-4.7.0/css/font-awesome.css"/>
</head>
<body>
<div class="topleft">
	    <span style="color: #00FFFF">&emsp;
			<i class="fa fa-map-marker" aria-hidden="true"></i>&nbsp;当前位置：
	        <span style="color:red;">图书管理</span>
	    </span>
</div>
<div style="padding: 100px 100px 10px;">
    <form class="bs-example bs-example-form input" role="form">
        <div class="input-group ">
            <span class="input-group-addon">用户名</span>
            <input type="text" class="form-control" placeholder="请输入···">
        </div>
        <br>
        <div class="input-group">
            <span class="input-group-addon">手机号</span>
            <input type="text" class="form-control"  placeholder="请输入···">
        </div>
    </form>
</div>
<br>
<div class="input-one">
    <button type="button" class="btn btn-default input-two" data-dismiss="modal">取消
    </button>
    <button type="button" class="btn btn-primary input-two">搜索
    </button>
</div>
<div class="information">
    <table class="table table-striped table-bordered table-hover table-condensed">
        <thead>
        <tr>
            <th class="thead">id</th>
            <th class="thead">书名</th>
            <th class="thead">出版社名</th>
            <th class="thead">作者</th>
            <th class="thead">图书介绍</th>
            <th class="thead">图书借阅状态</th>
            <th class="thead">选项</th>
        </tr>
        </thead>
        <tbody>
        <c:set var="totalPages" value="${requestScope.totalPages}"/>
        <c:set var="page" value="${requestScope.page}"/>
        <c:set var="currentPageUsers" value="${requestScope.userList.subList(beginIndex,endIndex)}"/>
        <c:forEach items="${bookList}" var="bookList">
            <tr>
                <td>
                    <label><input type="checkbox" value=""> ${bookList.id}</label>
                </td>
                <td>${bookList.bookName}</td>
                <td>${bookList.publishName}</td>
                <td>${bookList.author}</td>
                <td>${bookList.bookDescription}</td>
                <td>${bookList.isBorrow}</td>
                <td>
                    <a href="../insertBook.jsp" style="color: #FFD700;cursor:pointer"><i class="fa fa-eye" aria-hidden="true"></i> 添加</a>
                    <a href="/admin/selectUpdateBook?id=${bookList.id}" style="color: #00BFFF;cursor:pointer">&emsp;<i class="fa fa-pencil-square-o" aria-hidden="true"></i> 修改</a>
                    <a href="/admin/deleteBook?id=${bookList.id}" style="color:red;cursor:pointer">&emsp;<i class="fa fa-trash" aria-hidden="true"></i> 删除</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
<div>
    <div class="row justify-content-center pagination ul">
        <div>
            <nav>
                <ul class="pagination">
                    <li class="page-item"><a class="page-link" href="<c:url value="/admin/selectBook?page=1"/>">首页</a></li>
                    <li class="page-item"><a class="page-link" href="<c:url value="/admin/selectBook?page=${page-1>1?page-1:1}"/>">&laquo;</a>
                    </li>

                    <c:forEach begin="1" end="${totalPages}" varStatus="loop">
                        <c:set var="active" value="${loop.index==page?'active':''}"/>
                        <li class="page-item ${active}">
                            <a class="page-link" href="<c:url value="/admin/selectBook?page=${loop.index}"/>">${loop.index}</a>
                        </li>
                    </c:forEach>
                    <li class="page-item">
                        <a class="page-link" href="<c:url value="/admin/selectBook?page=${page+1<totalPages?page+1:totalPages}"/>">&raquo;</a>
                    </li>
                    <li class="page-item">
                        <a class="page-link" href="<c:url value="/admin/selectBook?page=${totalPages}"/>">尾页</a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>
</body>
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
</html>